package com.lfz.sso.service;

import com.lfz.sso.mapper.UserMapper;
import com.lfz.sso.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

@Service
public class UserService {

    @Autowired
    private UserMapper userMapper;


    public User queryUserOne(String username) {
/*
        Example e = new Example(User.class);
        Example.Criteria c = e.createCriteria();

        c.orEqualTo("user_name", username)
                .orEqualTo("mobile_phone", username)
                .orEqualTo("email", username);
        // e.and(null);
*/
        return userMapper.queryUserOne(username);

    }

    public List<User> queryUserAll() {

        return userMapper.selectAll();

    }
}
